﻿using System;
//
namespace PerceptiveMCAPI.Types
{
   public class Api_BaseInput
   {
      public string api_Method { get; private set; }
      public string api_URL { get; private set; }
      public string api_DataCenter { get; private set; }
      public string api_Version { get; private set; }
      public EnumValues.AccessType api_AccessType { get; set; }
      public EnumValues.OutputType api_OutputType { get; set; }
      public EnumValues.MethodType api_MethodType { get; set; }
      public bool api_EncodeRequest { get; set; }
      public bool api_Validate { get; set; }
      public bool api_CustomErrorMessages { get; set; }
      public bool api_SecureAccess { get; set; }
      public int api_Timeout { get; set; }
      public object api_UserData { get; set; }
      //
      internal string SubmitUrl { get; set; }
      // ---------------------------------------------------------
      public Api_BaseInput()
      {
         this.api_Method = GetMethod();
         this.api_URL = MCAPISettings.api_URL;
         this.api_DataCenter = MCAPISettings.api_DataCenter;
         this.api_Version = MCAPISettings.api_Version;
         this.api_AccessType = MCAPISettings.default_AccessType;
         this.api_OutputType = MCAPISettings.default_OutputType;
         this.api_MethodType = MCAPISettings.default_MethodType;
         this.api_EncodeRequest = MCAPISettings.default_EncodeRequest;
         this.api_Validate = MCAPISettings.default_Validate;
         this.api_CustomErrorMessages = MCAPISettings.default_CustomErrorMessages;
         this.api_SecureAccess = MCAPISettings.default_SecureAccess;
         this.api_Timeout = MCAPISettings.default_Timeout;
         //
         this.api_UserData = null;
      }
      // -------------------------------------------------------
      private string GetMethod()
      {
         string typeName = this.GetType().Name;
         string method = typeName.Remove( typeName.LastIndexOf( "Input", StringComparison.OrdinalIgnoreCase ) );
         return method;
      }
   }
}
